Communication service for transmitting events between software independently of applications

ABSTRACT

A communication service enabling events to be forwarded from at least one data producer to at least one data consumer, the service being characterized it that it comprises a distributor module and a set of filter modules, said distributor module possessing means for receiving said events and for forwarding them to said set of filter modules, and each filter module in said set having means for receiving said events, for filtering them in application of a respective filter mechanism, and for forwarding them to certain ones of said at least one data consumer.

[0001] The present invention relates to communication between softwarecomponents of a software application.

[0002] Very often, software applications are designed with littleprovision for future development. Under such circumstances, they areoften monolithic, i.e. they are formed by a single software component,or by a plurality of software components, but with no attempt being madeto ensure that these software components are independent of one another.In other words, each component of the software application is designedfor the purpose of being an integral portion of the softwareapplication.

[0003] Nevertheless, it is known that attempts can be made to ensurethat each of the software components is independent of the others. To dothis, coupling between the various components constituting theapplication is reduced by establishing well-specified interfaces betweenthem together with communication mechanisms enabling them to interchangeinformation.

[0004]FIG. 1 illustrates such a mechanism. That mechanism is describedin the work by Erich Gamma, Richard Helm, Ralph Johnson, and JohnVlissides, “Design patterns—elements of reusable object-orientedsoftware”, published by Addison-Wesley (5th edition, 1995).

[0005] According to that document, the software components of a givenapplication (or possibly of a plurality of applications) interchangemessages via a communication service D generally referred to as adispatcher or a dispatching event service. Each software component canbe considered as producing data P or as consuming data C₁, C₂, C₃(referred to as an “observer” in that work).

[0006] Naturally, in practice, any given software component can possessboth roles, i.e. it can both be a producer of data and a consumer ofdata. Nevertheless, in the interest of clarity, the explanation isrestricted to software components having either a data-producing role ora data-consuming role.

[0007] In general, the data is structured in the form of events, i.e. asmessages that are issued asynchronously, complying with a well-specifiedformat.

[0008] In that state of the art, the data consumers C₁, C₂, and C₃ needto register with the communication service D, specifying the types ofevent they seek to receive. Similarly, data producers P issue events tothe communication service D without worrying about their finaldestinations: thus, destination handling is delegated to thecommunication service D.

[0009] As a result, each time a data producer P issues an event to thecommunication service D, it is up to the communication service todetermine which data consumers are to receive the event, as a functionof information which the data consumers specified on registering.

[0010] Unfortunately, that solution is not satisfactory.

[0011] The main problem results from the fact that handling of thefiltering and routing of events is dedicated to the communicationservice which lies outside the application.

[0012] More precisely, that requires the communication service to beaware of the internal functioning of the application, even though it isitself external thereto. In order to be able to route events to theappropriate data consumer, the communication service must implement theevent-routing policy that is desired by the application. Consequently,the split between that which is specific to the application and thatwhich is not specific to the application is poor and the overall systemlacks flexibility.

[0013] Furthermore, the communication server D must be capable ofinterpreting the events that reach it from the data producers P in orderto be able to determine which data consumers C are to receive the data,on the basis of information previously supplied by the consumers.

[0014] In the prior art, this can be done in two different ways.

[0015] In a first solution, each type of event is implemented in theform of a different class. The term “class” is used here in theobject-oriented programming sense. Correspondingly, data consumersregister with the communication server for one or more classes.

[0016] Thus, by determining the class of an event received from a dataproducer, the communication server can determine the data consumers towhich it must route the event it has received.

[0017] A first drawback of acting in that way is that filtering cannotbe very fine since the nature of the data contained in an event is notanalyzed.

[0018] Another drawback it that it requires numerous classes of event tobe created, which makes it quite complex to implement.

[0019] Another way of proceeding thus consists in the communicationserver analyzing the data contained in the events it receives. Dependingon the information provided by the data consumers, the communicationserver can determine the data consumers to which it is to route areceived event. To be able to do this it must know how data isstructured within events. Since data structures depend on applications,that means that the communication server must have in-depth knowledge ofthe internal mechanisms of the various applications that make use of itsservices.

[0020] Consequently, acting in that way involves a loss of independencefor the communication server relative to applications, and means thatthe communication server becomes very complex.

[0021] Prior art solutions are therefore not very satisfactory. Theobject of the present invention is to enable events to be communicatedbetween one or more data producers and one or more data consumers via acommunication server that is independent of the applications and thatprovides good filtering performance.

[0022] To do this, the invention provides a communication serviceenabling events to be transferred from at least one data producer to atleast one data consumer. The communication service is characterized inthat it comprises a distributor module and a set of filter modules,which set might possibly be constituted by a singleton. The distributormodule possesses means for receiving events and for forwarding them tothe set of filter modules, and each of the filter modules in the set hasmeans for receiving them, for filtering them in application of arespective filter mechanism, and for forwarding them to certain dataconsumers.

[0023] In this manner, each software application can specify to thecommunication service which filter module it desires to use. The filtermodules can then be specific to an application (or at least to a giventype of application) and can implement filter methods that require thedata contained in the event to be analyzed, while nevertheless ensuringthat the communication server continues to be generic since it is onlythe filter modules that are application-specific.

[0024] As can be understood by the person skilled in the art, thevarious means available to the filter modules and the distributor modulecan be implemented by execution threads. In other words, the filtermodules and the distributor module can be executed in parallel and inindependent manner.

[0025] The invention also provides a method enabling a data consumer toregister with such a communication service. This method comprises:

[0026] A first step consisting in the data consumer sending aregistration message to the distributor module. The message containsinformation concerning a filter mechanism.

[0027] A second step consisting in the distributor module sending to afilter module determined by said information, information relating tothe data consumer so as to enable it to be registered.

[0028] In an implementation of the invention, the filter modules can beadded by applications, in particular in dynamic manner, i.e. during thelifetime of the system without stopping it.

[0029] The invention thus also provides a method enabling thecommunication service to be used by a data consumer. This methodcomprises:

[0030] a first step consisting in the consumer sending to thedistributor module a message containing information relating to at leastone filter module;

[0031] a second step consisting in the distributor module forwardingevents to the filter module(s); and

[0032] a third step consisting in the filter module(s) filtering saidevent and then forwarding them to the data consumer.

[0033] Other characteristics and advantages of the invention will appearmore clearly in the following description made with reference to theaccompanying figures.

[0034]FIG. 1, described above, illustrates a prior art architecture fora communication server.

[0035]FIG. 2 is a diagram of a communication server in accordance withthe present invention.

[0036]FIG. 3 illustrates the method whereby a new filter module isregistered with the communication server.

[0037] The communication service, referenced D in FIG. 2, is constitutedfirstly by a first software element referred to below as the distributormodule and referenced R, and secondly by a set of software modulesreferred to as filter modules and referenced F₁, F₂, F₃, . . . , F_(m)where m is the number of such filter modules.

[0038] The distributor R receives events from one or more data producersP. On receiving them, it forwards them directly to the filter modules,without analyzing them.

[0039] The filter modules F₁ to F_(m) have means for analyzing the datacontained in the events. Each of them can implement a different filtermechanism. Depending on the analysis they perform and the filtermechanisms they implement, the filter modules then determine, for eachreceived event, whether or not it needs to be forwarded. When an eventis not filtered-out (i.e. when it is to be forwarded), it is forwardedto those data consumers C₁, C₂, C₃, . . . , C_(n), which have registeredwith the filter module in question.

[0040] Unlike the prior art solutions, there is no need here todetermine a subset of data consumers to which events are to be forwardedafter filtering: events are forwarded to all of the data consumersregistered with any given filter module. It will be understood that thefilter module structure, and a fortiori, the structure of thecommunication service overall, is thereby simplified.

[0041]FIG. 3 represents the mechanism implemented when a softwareapplication wishes to register with the communication service.

[0042] From the point of view of the communication service, a softwareapplication can be considered as a set of data consumers and dataproducers.

[0043] Thus, when an application desires to use the communicationservice, it needs to proceed with registering a certain number ofsoftware elements as data consumers with said communication service.

[0044] This registration mechanism is illustrated by FIG. 3.

[0045] In a step represented by arrow 1, the data consumer C registerswith the communication service D by sending a registration message tothe distributor module R. This registration message contains informationrelating to the desired filter mechanism, and in particular it cancontain an identifier of the filter module which is to be used. By wayof example, this identifier is a pointer or an address.

[0046] The information can also contain parameters of the filtermechanism (e.g. a sorting criterion).

[0047] Finally, the information supplied by the registration messagecontains an identifier of the data consumer C.

[0048] Thereafter, in a step represented by arrow 2, the distributormodule R forwards the identifier of the data consumer as received in thepreceding step to the filter module F as determined by the informationsupplied by the data consumer.

[0049] In addition, the distributor module R can also forward otherinformation to the filter module F, in particular any parameters thatmight have been supplied by the data consumer.

[0050] The filter module F can then store all of said information. Inthe invention, provision can be made for the filter module F to includestorage means (e.g. a memory zone organized as a table) listing all ofthe data consumers C that have registered with it in this way.

[0051] Thus, when the filter module receives an event from thedistributor module R, it is in a position to forward the event to thatset of data consumers, possibly after taking account of any specificparameters that might be associated with them.

[0052] When an application seeks to use the communication service, itcan, prior to registering data consumers, begin by registering one ormore filter modules. It can also register filter modules even after ithas begun to use the communication service.

[0053] To do this, the application, in particular via the dataconsumers, can send a message to the distributor module. The message cancontain information relating to the filter module, and in particular anidentifier (a pointer, an address, . . . ). The distributor module thuspossesses means for receiving such messages, and means for adding thenew filter module to the set of filter modules that it manages.

[0054] More precisely, the distributor module can possess storage meansenabling it to list the set of filter modules (by means of theiridentifiers), optionally associating them with parameters.

[0055] Each time the distributor module receives an event from a dataproducer, it is thus in a position, with the help of said memory means,to forward the event to the set of filter modules

1/ A communication service (D) enabling events to be forwarded from atleast one data producer (P) to at least one data consumer (C₁, C₂, C₃, .. . , C_(n)), the service being characterized it that it comprises adistributor module (R) and a set of filter modules (F₁, F₂, F₃, . . . ,F_(m)), said distributor module possessing means for receiving saidevents and for forwarding them to said set of filter modules, and eachfilter module in said set having means for receiving said events, forfiltering them in application of a respective filter mechanism, and forforwarding them to certain ones of said at least one data consumer. 2/ Acommunication service according to the preceding claim, in which each ofthe filter modules of said set possesses means for establishing its ownfilter mechanism as a function of information forwarded by said at leastone data consumer to said communication service. 3/ A communicationservice according to either one of the preceding claims, in which eachof the filter modules of said set possesses means for storing the dataconsumers to which it is to forward said event. 4/ A communicationservice according to any preceding claim, characterized it that saiddistributor module possesses means for receiving a message from said atleast one data consumer, the message containing information relating toa new filter module, and to add said new filter module to said set offilter modules. 5/ A method of registering a data consumer with acommunication service (D), said communication service comprising adistributor module (R) and a set of filter modules (F), said methodcomprising: a first step (1) consisting in said data consumer (C)sending a registration message to said distributor module (4), themessage containing information relating to a filter mechanism; and asecond step (2) consisting in said distributor module sending to afilter module determined from said information relating to a filtermechanism information relating to said data consumer (C) enabling thedata consumer to be registered. 6/ A method whereby a data consumer (C)uses a communication service (D) comprising at least a distributormodule (R) suitable for receiving events, said method comprising: afirst step consisting in said data consumer sending a message containinginformation relating to at least one filter module (F) to saiddistributor module (R); a second step consisting in the distributormodule (D) forwarding said events to said at least one filter module;and a third step consisting in said at least one filter module filteringsaid events and then forwarding them to said data consumer.